import request from '@/utils/http'

// 获取品牌分类列表
export const reqBrandList = (page, limit) => {
  return request.get(`/admin/product/baseTrademark/${page}/${limit}`)
}
// 新增品牌分类
export const reqAddBrand = (trademark) => {
  return request.post('/admin/product/baseTrademark/save', trademark)
}
// 修改品牌分类
export const reqUpdateBrand = (trademark) => {
  return request.put('/admin/product/baseTrademark/update', trademark)
}
// 删除品牌分类
export const reqDeleteBrand = (id) => {
  return request.delete(`/admin/product/baseTrademark/remove/${id}`)
}

// 获取属性管理一级分类
export const reqGetCategory1 = () => {
  return request.get('/admin/product/getCategory1')
}
// 获取属性管理二级分类
export const reqGetCategory2 = (category1Id) => {
  return request.get(`/admin/product/getCategory2/${category1Id}`)
}
// 获取属性管理三级分类
export const reqGetCategory3 = (category2Id) => {
  return request.get(`/admin/product/getCategory3/${category2Id}`)
}
// 商品基础属性接口
export const reqGetAttrList = (category1Id, category2Id, category3Id) => {
  return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
}

// 添加和修改商品属性接口
export const reqAddAttr = (attr) => {
  return request.post('/admin/product/saveAttrInfo', attr)
}
// 删除商品属性接口
export const reqDeleteAttr = (attrId) => {
  return request.delete(`/admin/product/deleteAttr/${attrId}`)
}